/**
 *****************************************************************************
 * @file
 * @brief
 * @author Moon
 * @version V1.0.0
 * @date 2021/05/19
 ****************************************************************************
 */
#ifndef _PARM_MANAGE_H
#define _PARM_MANAGE_H

#include <stdint.h>
#include "drv_f4_flash.h"
#include "dev_fm24clxx.h"
#include "StorageAddr.h"
#include "parm_id.h"
/* Public defines -----------------------------------------------------------*/

/* Public Struct -----------------------------------------------------------*/
typedef struct {
    uint16_t size;
    uint16_t offset;
} parm_info_t;
/* Public enum -----------------------------------------------------------*/

/* Public Variable ---------------------------------------------------------*/
//Pointer

//Array

//Const

/* Pubilc function prototypes -----------------------------------------------*/
int REG_PPInit(drv_flash_t *drv_f, dev_fm24_t *dev_f);
uint8_t PPGetInitFlag(uint16_t id);
uint8_t PPItemCopyToDataDevice(void);
uint8_t PPUpdateInfoCopyToFlash(void);
uint8_t PPItemRead(uint16_t id, uint8_t *data, uint16_t len);
uint8_t PPItemIWrite(uint16_t id, uint8_t *data, uint16_t len);
void PPResetDefault(uint8_t mode);

#if defined(USE_EXTERNAL_FRAM)
    void PPChangeStoreMode(uint8_t mode);
    uint8_t PPGetStoreMode(void);
#endif

#endif /* _PARM_MANAGE_H */
